mysql> show global status like 'innodb_row_lock%';
+-------------------------------+--------+
| Variable_name                 | Value  |
+-------------------------------+--------+
| Innodb_row_lock_current_waits | 0      |
| Innodb_row_lock_time          | 101284 |
| Innodb_row_lock_time_avg      | 50642  |
| Innodb_row_lock_time_max      | 50705  |
| Innodb_row_lock_waits         | 2      |
+-------------------------------+--------+
5 rows in set (0.00 sec)


mysql> SELECT r.trx_id waiting_trx_id,  r.trx_mysql_thread_id waiting_thread,
    ->        r.trx_query waiting_query,
    ->        b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread,
    ->        b.trx_query blocking_query
    -> FROM       information_schema.innodb_lock_waits w
    -> INNER JOIN information_schema.innodb_trx b  ON  b.trx_id = w.blocking_trx_id
    -> INNER JOIN information_schema.innodb_trx r  ON  r.trx_id = w.requesting_trx_id;
+----------------+----------------+----------------------------------------+-----------------+-----------------+----------------+
| waiting_trx_id | waiting_thread | waiting_query                          | blocking_trx_id | blocking_thread | blocking_query |
+----------------+----------------+----------------------------------------+-----------------+-----------------+----------------+
| 43C6103        |              3 | update ib_test set id = 4 where id = 5 | 43C6101         |               2 | NULL           |
+----------------+----------------+----------------------------------------+-----------------+-----------------+----------------+
1 row in set (0.00 sec)

mysql> select * from innodb_locks;
+----------------+-------------+-----------+-----------+------------------+-------------------+------------+-----------+----------+----------------+
| lock_id        | lock_trx_id | lock_mode | lock_type | lock_table       | lock_index        | lock_space | lock_page | lock_rec | lock_data      |
+----------------+-------------+-----------+-----------+------------------+-------------------+------------+-----------+----------+----------------+
| 43C6103:11:3:2 | 43C6103     | X         | RECORD    | `test`.`ib_test` | `GEN_CLUST_INDEX` |         11 |         3 |        2 | 0x000000002200 |
| 43C6101:11:3:2 | 43C6101     | S         | RECORD    | `test`.`ib_test` | `GEN_CLUST_INDEX` |         11 |         3 |        2 | 0x000000002200 |
+----------------+-------------+-----------+-----------+------------------+-------------------+------------+-----------+----------+----------------+


mysql> show innodb status\G
*************************** 1. row ***************************
  Type: InnoDB
  Name: 
Status: 
=====================================
100408 17:17:21 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 23 seconds
----------
BACKGROUND THREAD
----------
srv_master_thread loops: 4 1_second, 4 sleeps, 0 10_second, 6 background, 6 flush
srv_master_thread log flush and writes: 4
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 4, signal count 4
Mutex spin waits 1, rounds 18, OS waits 0
RW-shared spins 4, OS waits 4; RW-excl spins 0, OS waits 0
Spin rounds per wait: 18.00 mutex, 30.00 RW-shared, 0.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter 43C6105
Purge done for trx's n:o < 43C5B02 undo n:o < 0
History list length 12
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started, process no 31718, OS thread id 2838752112
MySQL thread id 4, query id 185 localhost root
---TRANSACTION 0, not started, process no 31718, OS thread id 2839354224
MySQL thread id 1, query id 186 localhost root
show innodb status
---TRANSACTION 43C6103, ACTIVE 38 sec, process no 31718, OS thread id 2838952816 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 320, 1 row lock(s)
MySQL thread id 3, query id 147 localhost root Updating
update ib_test set id = 4 where id = 5
------- TRX HAS BEEN WAITING 38 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 11 page no 3 n bits 72 index `GEN_CLUST_INDEX` of table `test`.`ib_test` trx id 43C6103 lock_mode X waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
 0: len 6; hex 000000002200; asc     " ;;
 1: len 6; hex 000000001102; asc       ;;
 2: len 7; hex 80000000330110; asc     3  ;;
 3: len 4; hex 80000005; asc     ;;

------------------
TABLE LOCK table `test`.`ib_test` trx id 43C6103 lock mode IX
RECORD LOCKS space id 11 page no 3 n bits 72 index `GEN_CLUST_INDEX` of table `test`.`ib_test` trx id 43C6103 lock_mode X waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
 0: len 6; hex 000000002200; asc     " ;;
 1: len 6; hex 000000001102; asc       ;;
 2: len 7; hex 80000000330110; asc     3  ;;
 3: len 4; hex 80000005; asc     ;;

---TRANSACTION 43C6101, ACTIVE 99 sec, process no 31718, OS thread id 2839153520
2 lock struct(s), heap size 320, 2 row lock(s)
MySQL thread id 2, query id 69 localhost root
TABLE LOCK table `test`.`ib_test` trx id 43C6101 lock mode IS
RECORD LOCKS space id 11 page no 3 n bits 72 index `GEN_CLUST_INDEX` of table `test`.`ib_test` trx id 43C6101 lock mode S
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
 0: len 8; hex 73757072656d756d; asc supremum;;

Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
 0: len 6; hex 000000002200; asc     " ;;
 1: len 6; hex 000000001102; asc       ;;
 2: len 7; hex 80000000330110; asc     3  ;;
 3: len 4; hex 80000005; asc     ;;

--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
 ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
250 OS file reads, 16 OS file writes, 15 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.39 writes/s, 0.35 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2,
0 inserts, 0 merged recs, 0 merges
Hash table size 415141, node heap has 1 buffer(s)
0.00 hash searches/s, 0.30 non-hash searches/s
---
LOG
---
Log sequence number 18362957625
Log flushed up to   18362957625
Last checkpoint at  18362957625
0 pending log writes, 0 pending chkp writes
12 log i/o's done, 0.09 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 106217472; in additional pool allocated 0
Dictionary memory allocated 61064
Buffer pool size   6400
Free buffers       6172
Database pages     227
Old database pages 0
Modified db pages  0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 223, created 4, written 11
0.00 reads/s, 0.17 creates/s, 0.43 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s
LRU len: 227, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 31718, id 2847746928, state: waiting for server activity
Number of rows inserted 0, updated 0, deleted 0, read 1
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================

1 row in set, 1 warning (0.00 sec)

